module MicroConcert
  module MicroConcertsController
    # GET /micro_concerts
    # GET /micro_concerts.xml
    def index
      @micro_concerts = MicroConcert.find(:all)
      
      respond_to do |format|
        format.html # index.html.erb
        format.xml  { render :xml => @micro_concerts }
      end
    end
    
    # GET /micro_concerts/1
    # GET /micro_concerts/1.xml
    def show
      @micro_concert = MicroConcert.find(params[:id])
      
      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @micro_concert }
      end
    end
    
    # GET /micro_concerts/new
    # GET /micro_concerts/new.xml
    def new
      @micro_concert = MicroConcert.new
      
      respond_to do |format|
        format.html # new.html.erb
        format.xml  { render :xml => @micro_concert }
      end
    end
    
    # GET /micro_concerts/1/edit
    def edit
      @micro_concert = MicroConcert.find(params[:id])
    end
    
    # POST /micro_concerts
    # POST /micro_concerts.xml
    def create
      @micro_concert = MicroConcert.new(params[:micro_concert])
      
      respond_to do |format|
        if @micro_concert.save
          flash[:notice] = 'MicroConcert was successfully created.'
          format.html { redirect_to(@micro_concert) }
          format.xml  { render :xml => @micro_concert, :status => :created, :location => @micro_concert }
        else
          format.html { render :action => "new" }
          format.xml  { render :xml => @micro_concert.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # PUT /micro_concerts/1
    # PUT /micro_concerts/1.xml
    def update
      @micro_concert = MicroConcert.find(params[:id])
      
      respond_to do |format|
        if @micro_concert.update_attributes(params[:micro_concert])
          flash[:notice] = 'MicroConcert was successfully updated.'
          format.html { redirect_to(@micro_concert) }
          format.xml  { head :ok }
        else
          format.html { render :action => "edit" }
          format.xml  { render :xml => @micro_concert.errors, :status => :unprocessable_entity }
        end
      end
    end
    
    # DELETE /micro_concerts/1
    # DELETE /micro_concerts/1.xml
    def destroy
      @micro_concert = MicroConcert.find(params[:id])
      @micro_concert.destroy
      
      respond_to do |format|
        format.html { redirect_to(micro_concerts_url) }
        format.xml  { head :ok }
      end
    end
  end
end